/* 表单基础样式 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* 下拉选择框样式 */
.form-select {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-md);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-white);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: 16px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    appearance: none;
}

.form-select:focus {
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* 表单验证状态 */
.form-control.is-invalid {
    border-color: var(--color-danger);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--color-danger);
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* 表单布局 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(-1 * var(--spacing-md));
    margin-left: calc(-1 * var(--spacing-md));
}

.form-row > .form-group {
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    flex: 1;
}

/* 编辑表单特殊样式 */
#editForm .form-group {
    margin-bottom: var(--spacing-lg);
}

#editForm .form-label {
    font-weight: 500;
    color: var(--text-primary);
}

#editForm .form-control,
#editForm .form-select {
    background-color: var(--bg-white);
}

/* 禁用状态 */
.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-light);
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row > .form-group {
        margin-right: 0;
        margin-left: 0;
    }
    
    .form-group {
        margin-bottom: var(--spacing-md);
    }
}

/* 表单内的帮助文本 */
.form-text {
    margin-top: var(--spacing-xs);
    font-size: 0.875em;
    color: var(--text-secondary);
}

/* 表单内的复选框和单选框 */
.form-check {
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: var(--spacing-sm);
}

.form-check-input {
    float: left;
    margin-left: -1.5em;
}

.form-check-label {
    margin-bottom: 0;
} 